home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / A / AxoCalculator Package / AxoCalculator AutoLoad / pA to pS Conversion < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.4 KB  |  68 lines  |  [TEXT/AxoC]

  1. LocalLanguage Pascal
  2. {-------------------------------------------------
  3. This document contains a procedure for converting
  4. between pA and pS, taking into account the membrane
  5. potential. This is a problem neuroscience researchers 
  6. often encounter when working with single channels.
  7.   
  8.     pApS is equivalent to pSpA 
  9.  
  10. •  To load these functions choose "Select All" under 
  11.     the "Edit" menu, then press "enter". 
  12.  
  13. --------------------------------------------------}
  14. Var
  15.     mV, pA, pS: Real
  16.  
  17. {• Single channel properties  •}
  18. procedure pSpA
  19. Var 
  20.     done:    Boolean
  21. begin
  22.     done = False
  23.     Repeat
  24.         PoseDialog ('\rSingle Channel Properites.\rSet unknown parameter to zero',
  25. &            'Holding potential : mV',mV,
  26. &            'Channel current : pA', pA, 
  27. &            'Channel conductance : pS', pS )
  28.     
  29.         if pA = 0 then        { calculate single channel current in pA }
  30.         begin
  31.             pA = pS * mV / 1000
  32.             done = True
  33.         end
  34.         else
  35.         begin
  36.             if mV = 0 then        { calculate holding potential in mV }
  37.             begin
  38.                 mV = pA * 1000 / pS
  39.                 done = True
  40.             end
  41.             else        { calculate single channel conductance in pS }
  42.             begin
  43.                 if pS = 0 then
  44.                 begin
  45.                     pS = pA * 1000 / mV
  46.                     done = True
  47.                 end
  48.             end
  49.         end
  50.         if done then
  51.         begin
  52.             WriteLn ('Holding potential = ',mV,' mV')
  53.             WriteLn ('Current = ',pA,' pA')
  54.             WriteLn ('Conductance = ',pS,' pS')
  55.         end
  56.         else
  57.         begin
  58.             Alert ('No calculation was performed.\nPlease set the unknown value to zero.')
  59.         end
  60.     until done
  61. end
  62.     
  63. procedure pApS
  64. begin
  65.     pSpA
  66. end
  67.  
  68.